<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        color: red;
        width: 100px;
        height: 200px;
      }
      .box::after {
        content: "123";
        width: 50px;
        height: 50px;
      }
    </style>
  </head>
  <body>
    <div class="box" style="color: red">111</div>
    <script>
      var boxEle = document.querySelector(".box");
      console.log(boxEle.style.color);
      //   获取非行间样式getComputedStyle ie8.0以上
      //             currentStyle  ie8.0以下
    </script>
  </body>
</html>
